package com.lyn.utils;

import java.util.Random;

/**
 * @author longyn 2023/5/22
 * @version 1.0.0
 */
public class RandomUtil {

    /**
     * 生成指定范围内的随机整数
     *
     * @param lowerBound 下限值
     * @param upperBound 上限值
     * @return 生成的随机整数
     */
    public static int getRandomInt(int lowerBound, int upperBound) {
        Random rand = new Random();
        int range = upperBound - lowerBound + 1;
        return (int) (rand.nextDouble() * range + lowerBound);
    }

}
